package com.qww;

public class Test06 {
}

class EquivalenceInteger {
    public static void main(String[] args) {
        Integer n1 = 10;
        Integer n2 = 10;
        System.out.println(n1 == n2);  // true
        System.out.println(n1 != n2);  // false

        Integer n3 = new Integer(10);
        Integer n4 = new Integer(10);
        System.out.println(n3 == n4);  // false
        System.out.println(n3 != n4);  // true
    }
}

class EqualMethod {
    public static void main(String[] args) {
        Integer n1 = new Integer(10);
        Integer n2 = new Integer(10);
        System.out.println(n1.equals(n2));  // true
    }
}

class Value {
    int i;
}

class EqualMethod2 {
    public static void main(String[] args) {
        Value v1 = new Value();
        Value v2 = new Value();
        System.out.println(v1.equals(v2));  // false
    }
}
